using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DTO;
using DAL;
using BUS;
using Utility;
public partial class Admin_themtraloimoi : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            loadDropDownList();
        }
    }
    private void loadDropDownList()
    {
        ddl_binhluan.DataSource = tbBinhLuanBUS.GetAll();
        ddl_binhluan.DataTextField = tbBinhLuanColumns.mabl.ToString();
        ddl_binhluan.DataValueField = tbBinhLuanColumns.mabl.ToString();
        ddl_binhluan.DataBind();
        ddl_binhluan.Items.Insert(0, new ListItem("All", "0"));

        ddl_khachhang.DataSource = tbKhachHangBUS.GetAll();
        ddl_khachhang.DataTextField = tbKhachHangColumns.hotenkh.ToString();
        ddl_khachhang.DataValueField = tbKhachHangColumns.makh.ToString();
        ddl_khachhang.DataBind();
        ddl_khachhang.Items.Insert(0, new ListItem("All", "0"));
    }
    protected void btn_Add_Click(object sender, EventArgs e)
    {
        //try
        //{
        //    tbTraLoi traLoi = new tbTraLoi();
        //    traLoi.binhluan = int.Parse(ddl_binhluan.SelectedValue.ToString());
        //    traLoi.khachhang = int.Parse(ddl_khachhang.SelectedValue.ToString());
        //    traLoi.traloi = txt_traloi.Text.ToString();
        //    tbTraLoiBUS.Insert(traLoi);
        //    Response.Redirect("~/Admin/danhsachtraloi.aspx");
        //}
        //catch
        //{
        //}
        //Response.Redirect("~/Admin/danhsachtraloi.aspx");
    }
    protected void btn_Reset_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/Admin/danhsachtraloi.aspx");
    }
}
